package day3;

import java.util.Scanner;

public class demo2 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int x=scanner.nextInt();
        int []arr=new int[n];

        for (int j = 0; j <n ; j++) {
            arr[j]= scanner.nextInt();
        }
        int l=-1;
        int r=-1;
        int minLength=Integer.MAX_VALUE;
        int sum=0;
        int left=0,right=0;
      while (left<=right&&right<n){
          if (sum>=x){
              if(right-left+1<minLength){
                  l=left;
                  r=right;
                  minLength=right-left+1;
              }
              sum-=arr[left++];
          }else {
              sum+=arr[right];
          }
      }
        System.out.println(l+" "+r);
    }
}
